<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
    <p>姓：<input v-model="firstName" type="text"></p>
    <p>名：<input v-model="lastName" type="text"></p>
    <p>全名：{{fullName}}</p>
</div>
</body>
<script>
    new Vue({
        el: "#root",
        data: {
            firstName: "",
            lastName: ""
        },
        computed: {
            fullName() {
                return this.firstName + this.lastName;
            }
        }
    })
</script>
</html>